<?php

use yii\db\Migration;

/**
 * Class m180112_183234_alter_instation_message_table
 */
class m180112_183234_alter_instation_message_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        $this->addColumn('instation_message', 'is_package', $this->smallInteger()->defaultValue(1)->comment('是否是资产包/1是资产包/2是项目'));
        $this->addColumn('instation_message', 'package_project_id', $this->smallInteger()->defaultValue(1)->comment('资产包或者项目ID'));
        $this->addColumn('instation_message', 'message_group', $this->smallInteger()->defaultValue(1)->comment('消息分类 1待审批提醒(11-访问/12立项) 2审批反馈(21-访问/22立项） 3关注更新'));
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        $this->dropColumn('instation_message', 'package_id');
        $this->dropColumn('instation_message', 'project_id');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180112_183234_alter_instation_message_table cannot be reverted.\n";

        return false;
    }
    */
}
